﻿<?php if($sf_request->getParameter('id')!=""): ?>
<div style="margin-top:-20px;"><?php echo link_to('Galeria de fotos', '/fotos/index') ?>
 > <?php echo $titleCollection ?>
<?php endif ?>
<h2>Galeria de fotos<br /><span></span></h2>
<div class="albumImages">
<ul>
<?php if($sf_request->getParameter('id')==""): ?>
	<?php foreach ($treeObject->fetchRoots() as $root): ?>
		<?php 
			$orderedRootPhotos = $root->getPhoto();
			if($root->getNode()->isRoot()): ?>
			<?php if($root->getNode()->isLeaf()): ?>
				<li style='float:left; margin-bottom:20px;'><a href="<?php echo url_for('@album?id='.$root['id']) ?>" title="<?php echo $root['titulo'] ?>"><img src="<?php echo sfConfig::get('app_fotos_collection_thumb_path').$root['id'].".jpg" ?>" /></a><div style="text-align:center;font-size:12px;color:#CCC;margin-top:-12px; *margin-top: 0px;"><?php echo $root['titulo'] ?></div></li>
			<?php else: ?>
				<li style='float:left; margin-bottom:20px;'><a href="<?php echo url_for('/fotos/index?id='.$root['id']) ?>" title="<?php echo $root['titulo'] ?>"><img src="<?php echo sfConfig::get('app_fotos_collection_thumb_path').$root['id'] ?>.jpg" /></a><div style="text-align:center;font-size:12px;color:#CCC;margin-top:-12px; *margin-top: 0px;"><?php echo $root['titulo'] ?></div></li>
			<?php endif ?>
		<?php endif ?>
	<?php endforeach ?>	<?php else: ?>
		<!-- Es la carpeta de videos -->
		<?php foreach ($children as $child):  ?>
			<li style='float:left; margin-bottom:20px;'><a href="<?php echo url_for('@album?id='.$child['id']) ?>" title="<?php echo $child['titulo'] ?>"><img src="<?php echo sfConfig::get('app_fotos_collection_thumb_path').$child->getPhoto()->getFirst()->getImagen() ?>" /></a><div style="text-align:center;font-size:12px;color:#CCC;margin-top:-12px; *margin-top: 0px;"><?php echo $child['titulo'] ?></div></li>
		<?php endforeach ?>

<?php endif ?>
</ul>
</div>